
import { Addenvironment, AddItem, saveproject, saveResources, saveTask, saveTList } from '@/utils/addindustry';
import { TableQuery } from '@/utils/interface';
import { request } from 'umi';
//获取项目列表的行业
export let getIndustry = () => {
    return request('/sxpt/label/selectTradeList')
}
//获取项目表格数据
export let getTableList = (params: TableQuery) => {
    return request('/sxpt/project/selectProjectList', { params })
}
//添加项目页面获取专业
export let getAddIndustrySkill = () => {
    return request('/sxpt/label/selectMajorStationList')
}
//编辑
export let getIndustryDetail = (versionId: string) => {
    return request(`/sxpt/project/selectProjectByVserionId?versionId=${versionId}`)
}
//编辑页面实训大纲
export let getTrainingSyllabus = () => {
    return request('/sxpt/brief/selectBriefTree')
}
//点击实训大纲的每一项
export let TrainingSyllabusItem = (briefId: string, proVersionId: string) => {
    return request(`/sxpt/brief/selectBriefTreeById?briefId=${briefId}&proVersionId=${proVersionId}`)
}
//实训大纲保存
export let saveTrainingSyllabusList = (data:saveTList) => {
    return request('/sxpt/brief',{
        method: 'POST',
        data
    })
}
//编辑页面前置项目
export let getLeadProject = () => {
    return request('/sxpt/frontPositionProject/selectPushProjectList')
}
//项目页面删除
export let DelIndustry = (Params: string) => {
    return request(`/sxpt/project/deleteProjectByVersionId?projectVersionId=${Params}`, {
        method: 'DELETE'
    });
}
//添加项目保存
export let AddIndustry = (data: AddItem) => {
    return request('/sxpt/project', {
        method: 'POST',
        data
    })
}
// //上传图片
export let getImg = (data: any) => {
    return request('/common/upload', {
        method: 'POST',
        data
    })
}
//添加任务
export let addTask = (data: saveTask) => {
    return request('/sxpt/task', {
        method: 'POST',
        data
    })
}
//渲染任务
export let renderTask = (params: string) => {
    return request(`/sxpt/task/selectTaskList/${params}`, {
        methods: 'GET'
    })
}
//删除任务
export let delTask = (params: string) => {
    return request(`/sxpt/task/deleteTask/${params}`)
}
//实训环境保存
export let saveEnvironment = (data: Addenvironment) => {
    return request('/sxpt/projectExperimental', {
        method: 'POST',
        data
    })
}
//前置项目保存
export let saveProject = (data: saveproject) => {
    return request('/sxpt/frontPositionProject', {
        method: 'POST',
        data
    })
};
//编辑页面项目资源
export let getProjectResources = () => {
    return request('/sxpt/projectResource/selectResourceTree')
}
//点击项目资源的每一项
export let ResourcesItem = (resourceId: string, proVersionId: string) => {
    return request(`/sxpt/projectResource/selectResourceById?resourceId=${resourceId}&proVersionId=${proVersionId}`)
};
//项目资源上传文件
export let getFile = (data: any) => {
    return request('/sxpt/projectResource/upload', {
        method: 'POST',
        data
    })
};
//项目资源保存
export let saveResoueces = (data: saveResources) => {
    return request('/sxpt/projectResource', {
        method: 'POST',
        data
    })
};

